Eulerian Number
In combinatorics, the Eulerian Number A(n, m), is the number of permutations of the numbers 1 to n in which exactly m elements are greater than previous element....
read more
Largest rectangular sub-matrix having sum divisible by k
Given a n x n matrix of integers. The problem is to find the largest area rectangular sub-matrix having sum divisible by the given value k....
read more
Count of N-size Arrays that can be formed starting with K such that every element is divisible by next
Given two integers N and K, the task is to find the number of different arrays of size N that can be formed having the first element as K such that every element except last, is divisible by the next element in the array. Since the count can be very large, so print the modulo 109 + 7....
read more
Ways to fill N positions using M colors such that there are exactly K pairs of adjacent different colors
Given three integers N, M and K. The task is to find the number of ways to fill N positions using M colors such that there are exactly K pairs of different adjacent colors....
read more
Find next greater number formed with exactly two unique digits for each Array element
Given an array arr[] having N integers, the task is to find the next greater number X i.e, X >= arr[i] for each i in the range [0, N) such that the count of unique digits in X is exactly 2....
read more
Count all possible paths from source to destination in given 3D array
Given three integers M, N and K, the task is to count all the possible paths from the cell (0, 0, 0) to cell (M-1, N-1, K-1) in a matrix of size (M, N, K).  Movement is allowed only in three directions, which are along the positive direction of the three axes i.e. from any cell (i, j, k) movement is allowed to cells (i+1, j, k), (i, j+1, k) and (i, j, k+1)....
read more
Minimum window size containing atleast P primes in every window of given range
Given three integers X, Y and P, the task is to find the minimum window size K such that every window in the range [X, Y] of this size have atleast P prime numbers.Examples:...
read more
Count of N digit numbers which contains all single digit primes
Given a positive integer N, the task is to count the number of N-digit numbers which contain all single digit primes....
read more
Number of ways to paint K cells in 3 x N grid such that no P continuous columns are left unpainted
Given three integers N, P and K, the task is to find the number of ways of painting K cells of 3 x N grid such that no adjacent cells are painted and also no continuous P columns are left unpainted. Note: Diagonal cells are not considered as adjacent cells. Examples:...
read more
Count numbers with exactly K non-zero digits and distinct odd digit sum
Given an Integer N, and a number K, the task is to find out the total numbers from 0 to N which have exactly K non zero digits and the sum of those digits should be odd and that sum should be distinct. The number N can be as large as 10^18.Examples:...
read more
Count of subsets of integers from 1 to N having no adjacent elements
Given an integer N, the task is to count the number of subsets formed from an array of integers from 1 to N which doesn’t contain adjacent elements. A subset can’t be chosen if it satisfies the non-adjacent element condition, but it is possible to add more elements.Examples:...
read more
OYO Interview Experience | Set 10 (On-campus for SDE)
OYO visited our campus recently....
read more